package com.itheima.common;

import java.util.List;

/**
 * @Description:分页对象(数据列表,总记录数,总页数)
 * @Version: V1.0
 */
public class PageResult<T> {

    /*总记录数*/
    private long total;
    /*总页数*/
    private int pages;
    /*分页后的数据*/
    private List<T> list;

    public PageResult() {
    }

    public PageResult(long total, int pages, List<T> list) {
        this.total = total;
        this.pages = pages;
        this.list = list;
    }

    @Override
    public String toString() {
        return "PageResult{" + "total=" + total + ", pages=" + pages + ", list=" + list + '}';
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public int getPages() {
        return pages;
    }

    public void setPages(int pages) {
        this.pages = pages;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }
}
